package com.douqu.game.core.web;

import com.bean.core.util.Utils;
import com.douqu.game.core.e.ReturnMessage;

/**
 * @Author: Bean
 * @Description:
 * @Date: 2018-08-27 9:45
 */
public class AppStoreNotifyParam {

    /**
     * 自定义的订单号
     */
    private String outTradeNo;
    /**
     * 苹果的订单号
     */
    private String transactionId;

    private String payload;

    private int serverId;

    private String playerIndex;

    private int serverRuleId;

    private int playerLv;

    private String gameVersion;

    public ReturnMessage check()
    {
        if(Utils.isNullOrEmpty(outTradeNo) || Utils.isNullOrEmpty(payload) || Utils.isNullOrEmpty(transactionId)
                || Utils.isNullOrEmpty(playerIndex)|| serverRuleId <= 0
                || Utils.isNullOrEmpty(gameVersion)|| serverId <= 0 || playerLv <= 0)
            return ReturnMessage.PARAM_ERROR;

        return null;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getPayload() {
        return payload;
    }

    public void setPayload(String payload) {
        this.payload = payload;
    }

    public int getServerId() {
        return serverId;
    }

    public void setServerId(int serverId) {
        this.serverId = serverId;
    }

    public String getPlayerIndex() {
        return playerIndex;
    }

    public void setPlayerIndex(String playerIndex) {
        this.playerIndex = playerIndex;
    }

    public String getGameVersion() {
        return gameVersion;
    }

    public void setGameVersion(String gameVersion) {
        this.gameVersion = gameVersion;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }


    public int getPlayerLv() {
        return playerLv;
    }

    public void setPlayerLv(int playerLv) {
        this.playerLv = playerLv;
    }

    public int getServerRuleId() {
        return serverRuleId;
    }

    public void setServerRuleId(int serverRuleId) {
        this.serverRuleId = serverRuleId;
    }

    @Override
    public String toString() {
        return "{" +
                "outTradeNo='" + outTradeNo + '\'' +
                ", transactionId='" + transactionId + '\'' +
                ", serverId=" + serverId +
                ", playerIndex='" + playerIndex + '\'' +
                ", serverRuleId='" + serverRuleId + '\'' +
                ", playerLv=" + playerLv +
                ", gameVersion='" + gameVersion + '\'' +
                '}';
    }
}
